package com.wg.sparkdemo.hive;

import org.apache.spark.sql.SparkSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestHive2 {
	
	private static Logger logger = LoggerFactory.getLogger(TestHive2.class);

    public static void main(String[] args) {
    	SparkSession spark = SparkSession.builder()
    			.config("hive.metastore.uris", "thrift://nsn-host135.nsn.com:9083")
    			.enableHiveSupport().appName("TestHive2")
    			.master("local[4]").getOrCreate();
    	
    	spark.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)");
    	spark.sql("LOAD DATA LOCAL INPATH 'data/kv1.txt' INTO TABLE src");
    }
}
